'use strict';

module.exports = app => {
  const { INTEGER, DATE } = app.Sequelize;

  const Collection = app.model.define('collection', {
    id: { type: INTEGER, primaryKey: true, autoIncrement: true },
    user_id: {
      type: INTEGER(64),
      allowNull: false,
      comment: '用户id',
    },
    goods_id: {
      type: INTEGER(64),
      allowNull: false,
      comment: '商品id',
    },
    created_at: DATE,
    updated_at: DATE,
  }, {
    sequelize:app.Sequelize,
    modelName: 'collection',
    tableName: 'collection',
    freezeTableName: true
  });

  return Collection;
};